package com.lagou.dockerdemo.mapper;

import com.lagou.dockerdemo.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description
 * @Author ch'ien
 * @Date 2021/8/31 16:09
 **/
@Mapper
public interface StudentMapper {

    @Select("select * from student")
    List<Student> getAll();

    @Select("select * from student where id = #{name}")
    Student getById(Long id);

    @Insert("insert into student  ( name ) VALUES (#{name})")
    int save(Student student);

    @Delete("delect tabel student where id = #{id}")
    int delById(Long id);

    @Update("update student set name = #{name} where id =#{id}")
    int updateById(Student student);
}
